package main

import (
	"github.com/labstack/echo/v4"
	"strconv"
)

func main() {

	e := echo.New()
	e.POST("/user", saveUser)
	e.GET("/user", getUser)
	e.PUT("/user", updateUser)
	e.DELETE("/user", deleteUser)

	e.Start(":80")
}

func saveUser(c echo.Context) error {
	return c.String(200, "Hello World")
}

func getUser(c echo.Context) error {
	param := c.Param("id")
	id, _ := strconv.Atoi(param)
	return c.String(200, strconv.Itoa(id))
}
func updateUser(c echo.Context) error {
	param := c.Param("id")
	id, _ := strconv.Atoi(param)
	return c.String(200, strconv.Itoa(id))
}
func deleteUser(c echo.Context) error {
	param := c.Param("id")
	id, _ := strconv.Atoi(param)
	return c.String(200, strconv.Itoa(id))
}
